<?php

class Model_DbTable_Apos_Grndata extends Zend_Db_Table_Abstract {
	
	public function getGrnNo($sCode){
		
		$whereStr = "SCODE LIKE '".$sCode."'";
		$row = $this->fetchRow($whereStr,"GRN_NO ASC");
		if(!$row) return false;
		return $row["GRN_NO"];
	}
	/**
	 * @author Leo
	 * @version 2014-07-08
	 * @param string $GrnNo
	 * Show all product detail by GrnNo
	 */
	public function getScode($GrnNo){
		$whereStr = "GRN_NO = '".$GrnNo."'";
		$row = $this->fetchAll($whereStr,"SCODE ASC");
		if(!$row) {return false;}
		return $row->toArray();
		
	}
	
	public function isNewProduct($sCode){
		$whereStr = "SCODE = '".$sCode."'";
		
		$row = $this->fetchRow($whereStr);
		if(!(boolean)$row) {
			return true;
		}
		return false;
		
	}
	
}

?>